﻿#include "GlobalUiStyle.h"
#include <QDebug>
QString styleButtonTrans = "PushButtonSystem {background-color:transparent;}";




QString styleLabelFormStatusLabelStatistics = "Label{\
        font-size:14px;\
font-family:\"Microsoft YaHei\";\
    font-weight:400;\
color:rgb(255,180,0);\
background:rgba(2,47,79,1);\
}";
QString styleLabelFormStatusShowText_online = "Label{\
        font-size:14px;\
font-family:\"Microsoft YaHei\";\
    font-weight:400;\
color:white;\
background-color:rgba(6,189,144,1);\
}";
QString styleLabelFormStatusShowText_offline = "Label{\
        font-size:14px;\
font-family:\"Microsoft YaHei\";\
    font-weight:400;\
color:white;\
background-color:rgba(214,77,84,1);\
}";
QString styleLabelFormStatusText = "Label{\
        font-size:14px;\
font-family:\"Microsoft YaHei\";\
    font-weight:400;\
color:rgba(0,240,255,255);\
border-image:transparent;\
}";
QString styleLabelFormTagTitle = "Label{\
        font-size:16px;\
font-family:\"Microsoft YaHei\";\
    font-weight:400;\
color:rgba(1,169,232,255);\
border-image:transparent;\
}";

QString styleLabelFormTagText = "Label{\
        font-size:22px;\
font-family:\"Microsoft YaHei\";\
    font-weight:400;\
color:rgba(0,240,255,255);\
border-image:transparent;\
}";


QString styleWidgetFormTag = "WidgetFormTag{\
        background:rgba(2,47,79,1);\
} ";

QString styleLabelFormTotalTitle = "Label{\
        font-size:14px;\
font-family:\"Microsoft YaHei\";\
    font-weight:400;\
color:rgba(1,169,232,255);\
border-image:transparent;\
}";

QString styleLabelFormTotalText_Color1 = "Label{\
        font-size:20px;\
font-family:\"Microsoft YaHei\";\
    font-weight:400;\
color:rgba(0,255,0,255);\
border-image:transparent;\
}";
QString styleLabelFormTotalText_Color2 = "Label{\
        font-size:20px;\
font-family:\"Microsoft YaHei\";\
    font-weight:400;\
color:rgba(255,180,0,255);\
border-image:transparent;\
}";
QString styleLabelFormTotalText_Color3 = "Label{\
        font-size:20px;\
font-family:\"Microsoft YaHei\";\
    font-weight:400;\
color:rgba(248,114,30,255);\
border-image:transparent;\
}";
QString styleLabelFormTotalRightText = "Label{\
        font-size:12px;\
font-family:\"Microsoft YaHei\";\
    font-weight:400;\
color:rgba(0,240,255,255);\
border-image:transparent;\
}";
QString styleWidgetFormTotal = "WidgetFormTotal{\
        background:rgba(2,47,79,1);\
} ";

QString styleCursorNorth =     ":/res/img/m_up_icon.png";
QString styleCursorSouth =     ":/res/img/m_lower_icon.png";
QString styleCursorEast =      ":/res/img/m_right_icon.png";
QString styleCursorWest =      ":/res/img/m_left_icon.png";
QString styleCursorNorthEast = ":/res/img/m_upright_icon.png";
QString styleCursorNorthWest = ":/res/img/m_upleft_icon.png";
QString styleCursorSouthEast = ":/res/img/m_lowerright_icon.png";
QString styleCursorSouthWest = ":/res/img/m_lowerleft_icon.png";


QString styleWidgetTitleHide = "";
QString styleCombox = "";
QString styleWidgetReplay = "";
QString styleLabelLoginRem = "";
QString stylePushButtonLoginRem_on = "";
QString stylePushButtonLoginRem_off = "";
QString styleLabelLoginUser = "";
QString styleButtonLoginSetting = "";
QString styleButtonLogin = "";
QString styleLabelText = "";
QString styleLabelDia = "";
QString styleLabelTextWhite = "";
QString styleLabelDialogTitle = "";
QString styleLButtonTitleClose = "";
QString styleLButtonTitleMin = "";
QString styleLButtonTitleMax = "";
QString styleLDialogLogin = "";
QString styleLLineEditUser = "";
QString styleWidgetLogin = "";
QString styleWidgetGlobal = "";
QString styleLPushButtonFuncReplay_off = "";
QString styleLPushButtonFuncReplay_on = "";
QString styleLPushButtonFuncVedio_off = "";
QString styleLPushButtonFuncVedio_on = "";
QString styleLPushButtonFuncStatus_off = "";
QString styleLPushButtonFuncStatus_on = "";
QString styleLPushButtonFuncSetting_off = "";
QString styleLPushButtonFuncSetting_on = "";
QString stylePushButtonFuncChild_off = "";
QString stylePushButtonFuncChild_on = "";
QString styleLabelFuncMenuLine = "";
QString stylePushButtonFuncMenu = "";
QString styleLabelAdminMenuUser = "";
QString styleLabelAdminMenuTrans = "";
QString styleLabelAdminMenuUser_on = "";
QString styleLabelAdminMenuTrans_on = "";
QString styleWidgetAdminMenuItem = "";
QString styleWidgetAdminMenuItem_on = "";
QString styleLabelAdminMenuLogout = "";
QString styleLabelAdminMenuLogout_on = "";
QString styleLabelAdminMenuManager = "";
QString styleLabelAdminMenuManagerr_on = "";
QString styleWidgetTrans = "";
QString stylePushButtonAdmin_off = "";
QString stylePushButtonAdmin_on = "";
QString styleWidgetFormSquare = "";
QString styleWidgetFormRect = "";
QString styleWidgetPanoTree = "";
QString styleLPushButtonRelpayLayout_off = "";
QString styleLPushButtonRelpayLayout_on = "";
QString styleLPushButtonTitleFix_off = "";
QString styleLPushButtonTitleFix_on = "";
QString styleLPushButtonGlobal = "";
  QString styleLPushButtonGlobal_off;
  QString styleLPushButtonGlobal_on;
    QString styleLTextBrowerGlobal;
    QString styleLScrollBarGlobal;

     QString styleLabelTitle_dark;
     QString styleLabelTitle_light;

GlobalUiStyle::GlobalUiStyle()
{
}

void GlobalUiStyle::reloadGlobalStyle()
{
    qDebug()<<"加载UI qss"<<endl;
    QFile file;
    file.setFileName(QString(UI_STYLE_PATH).append("Label.qss"));
    file.open(QFile::ReadOnly);
    styleLabelText = (file.readAll());
    file.close();

    QString filePath = QString(UI_STYLE_PATH).append("Label.qss");
    QFile fileTest(filePath);
    if(fileTest.exists())
        qDebug()<<filePath<<"文件存在";
    else
        qDebug()<<filePath<<"文件不存在";



    file.setFileName(QString(UI_STYLE_PATH).append("LabelDialogTitle.qss"));
    file.open(QFile::ReadOnly);
    styleLabelDialogTitle = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonTitle_close.qss"));
    file.open(QFile::ReadOnly);
    styleLButtonTitleClose = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonTitle_min.qss"));
    file.open(QFile::ReadOnly);
    styleLButtonTitleMin = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonTitle_max.qss"));
    file.open(QFile::ReadOnly);
    styleLButtonTitleMax = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("Dialog.qss"));
    file.open(QFile::ReadOnly);
    styleLDialogLogin = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("LineEditUser.qss"));
    file.open(QFile::ReadOnly);
    styleLLineEditUser = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("WidgetLogin.qss"));
    file.open(QFile::ReadOnly);
    styleWidgetLogin = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("WidgetGlobal.qss"));
    file.open(QFile::ReadOnly);
    styleWidgetGlobal = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonFuncReplay_off.qss"));
    file.open(QFile::ReadOnly);
    styleLPushButtonFuncReplay_off = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonFuncReplay_on.qss"));
    file.open(QFile::ReadOnly);
    styleLPushButtonFuncReplay_on = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonFuncVedio_off.qss"));
    file.open(QFile::ReadOnly);
    styleLPushButtonFuncVedio_off = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonFuncVedio_on.qss"));
    file.open(QFile::ReadOnly);
    styleLPushButtonFuncVedio_on = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonFuncStatus_off.qss"));
    file.open(QFile::ReadOnly);
    styleLPushButtonFuncStatus_off = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonFuncStatus_on.qss"));
    file.open(QFile::ReadOnly);
    styleLPushButtonFuncStatus_on = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonFuncSetting_off.qss"));
    file.open(QFile::ReadOnly);
    styleLPushButtonFuncSetting_off = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonFuncSetting_on.qss"));
    file.open(QFile::ReadOnly);
    styleLPushButtonFuncSetting_on = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonFuncChild_off.qss"));
    file.open(QFile::ReadOnly);
    stylePushButtonFuncChild_off = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonFuncChild_on.qss"));
    file.open(QFile::ReadOnly);
    stylePushButtonFuncChild_on = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("LabelFuncMenuLine.qss"));
    file.open(QFile::ReadOnly);
    styleLabelFuncMenuLine = (file.readAll());
    file.close();


    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonMenu.qss"));
    file.open(QFile::ReadOnly);
    stylePushButtonFuncMenu = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("LabelAdminMenuUser.qss"));
    file.open(QFile::ReadOnly);
    styleLabelAdminMenuUser = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("LabelAdminMenuTrans.qss"));
    file.open(QFile::ReadOnly);
    styleLabelAdminMenuTrans = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("LabelAdminMenuUser_on.qss"));
    file.open(QFile::ReadOnly);
    styleLabelAdminMenuUser_on = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("LabelAdminMenuTrans_on.qss"));
    file.open(QFile::ReadOnly);
    styleLabelAdminMenuTrans_on = (file.readAll());
    file.close();


    file.setFileName(QString(UI_STYLE_PATH).append("WidgetAdminMenuItem.qss"));
    file.open(QFile::ReadOnly);
    styleWidgetAdminMenuItem = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("WidgetAdminMenuItem_on.qss"));
    file.open(QFile::ReadOnly);
    styleWidgetAdminMenuItem_on = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("LabelAdminMenuLogout.qss"));
    file.open(QFile::ReadOnly);
    styleLabelAdminMenuLogout = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("LabelAdminMenuLogout_on.qss"));
    file.open(QFile::ReadOnly);
    styleLabelAdminMenuLogout_on = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("LabelAdminMenuManager.qss"));
    file.open(QFile::ReadOnly);
    styleLabelAdminMenuManager = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("LabelAdminMenuManager_on.qss"));
    file.open(QFile::ReadOnly);
    styleLabelAdminMenuManagerr_on = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("WidgetTrans.qss"));
    file.open(QFile::ReadOnly);
    styleWidgetTrans = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("LabelDia.qss"));
    file.open(QFile::ReadOnly);
    styleLabelDia = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonAdmin_off.qss"));
    file.open(QFile::ReadOnly);
    stylePushButtonAdmin_off = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonAdmin_on.qss"));
    file.open(QFile::ReadOnly);
    stylePushButtonAdmin_on = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("WidgetFormSquare.qss"));
    file.open(QFile::ReadOnly);
    styleWidgetFormSquare = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("WidgetFormRect.qss"));
    file.open(QFile::ReadOnly);
    styleWidgetFormRect = (file.readAll());
    file.close();


    file.setFileName(QString(UI_STYLE_PATH).append("WidgetPanoTree.qss"));
    file.open(QFile::ReadOnly);
    styleWidgetPanoTree = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonLoginSetting.qss"));
    file.open(QFile::ReadOnly);
    styleButtonLoginSetting = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonLogin.qss"));
    file.open(QFile::ReadOnly);
    styleButtonLogin = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("LabelLoginUser.qss"));
    file.open(QFile::ReadOnly);
    styleLabelLoginUser = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonLoginRem_on.qss.qss"));
    file.open(QFile::ReadOnly);
    stylePushButtonLoginRem_on = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonLoginRem_off.qss.qss"));
    file.open(QFile::ReadOnly);
    stylePushButtonLoginRem_off = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("LabelLoginRem.qss"));
    file.open(QFile::ReadOnly);
    styleLabelLoginRem = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("WidgetReplay.qss"));
    file.open(QFile::ReadOnly);
    styleWidgetReplay = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("Combox.qss"));
    file.open(QFile::ReadOnly);
    styleCombox = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonReplayLayout_off.qss"));
    file.open(QFile::ReadOnly);
    styleLPushButtonRelpayLayout_off = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonReplayLayout_on.qss"));
    file.open(QFile::ReadOnly);
    styleLPushButtonRelpayLayout_on = (file.readAll());
    file.close();


    file.setFileName(QString(UI_STYLE_PATH).append("WidgetTitleHide.qss"));
    file.open(QFile::ReadOnly);
    styleWidgetTitleHide = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonTitleFix_off.qss"));
    file.open(QFile::ReadOnly);
    styleLPushButtonTitleFix_off = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonTitleFix_on.qss"));
    file.open(QFile::ReadOnly);
    styleLPushButtonTitleFix_on = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButton.qss"));
    file.open(QFile::ReadOnly);
    styleLPushButtonGlobal = (file.readAll());
    file.close();


    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonGlobal_off.qss"));
    file.open(QFile::ReadOnly);
    styleLPushButtonGlobal_off = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("PushButtonGlobal_on.qss"));
    file.open(QFile::ReadOnly);
    styleLPushButtonGlobal_on = (file.readAll());
    file.close();


    file.setFileName(QString(UI_STYLE_PATH).append("TextBrowerGlobal.qss"));
    file.open(QFile::ReadOnly);
    styleLTextBrowerGlobal = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("ScrollBar.qss"));
    file.open(QFile::ReadOnly);
    styleLScrollBarGlobal = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("LabelTitle_dark.qss"));
    file.open(QFile::ReadOnly);
    styleLabelTitle_dark = (file.readAll());
    file.close();

    file.setFileName(QString(UI_STYLE_PATH).append("LabelTitle_light.qss"));
    file.open(QFile::ReadOnly);
    styleLabelTitle_light = (file.readAll());
    file.close();


}
